//单页面应用
//配置路由，再去main.js里导入
import Vue from "vue";
import VueRouter from "vue-router";
import HelloWorld from "@/components/HelloWorld.vue"
import register from "@/components/register.vue"
import mainframe from "@/components/mainframe.vue"
Vue.use(VueRouter);//引用 vue-router 中间件
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default new VueRouter({//单页面中点击链接刷新页面其他区域中内容
   
    mode:"hash",//开发的时候用hash模式，比较清楚。发布用history
    routes:[
        {
            path:"/",
            component:HelloWorld
        },
        {
            path:"/regist",
            component:register
        },
        {
            path:"/mainframe",
            component:mainframe
        }
       
     
    ]
})